#ifndef TCPCLIENT_H
#define TCPCLIENT_H

#include <QWidget>
#include <QFile>
#include <QTcpSocket>
#include "protocol.h"

namespace Ui {
class TcpClient;
}

class TcpClient : public QWidget
{
    Q_OBJECT

public:
    explicit TcpClient(QWidget *parent = nullptr);
    ~TcpClient();
    //加载配置方法
    void loadConfig();

//槽函数
public slots:
    //用于处理连接服务器成功事件
    void showConnect();

private slots:
    //void on_sendButton_clicked();

    void on_login_clicked();

    void on_register_2_clicked();

    void on_logout_clicked();

private:
    Ui::TcpClient *ui;
    //IP地址
    QString m_strIP;
    //端口号，无符号短整型
    quint16 m_usPort;
    //连接服务器，与服务器进行通信
    QTcpSocket m_tcpSocket;
};

#endif // TCPCLIENT_H
